export default function overload(object: any, name: string, func: any) {
    let old = object[name];
    object[name] = function() {
        if (func.length == arguments.length) {
            return func.apply(this, arguments);
        } else if (typeof old === 'function') {
            return old.apply(this, arguments);
        }
    }
}